<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('核酸检测记录')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "admin/detection";
        var userId = [[${userId}]];

		$(function() {
			var options = {
				url: prefix + "/list",
				showSearch: false,
				showRefresh: false,
				showToggle: false,
				showColumns: false,
				queryParams: queryParams,
				modalName: "记录",
				columns: [
				{
					field: 'detectionId',
					title: '核酸检测表',
					visible: false
				},
				{
					field: 'userId',
					title: '用户ID',
					visible: false
				},
				{
					field: 'sysUser.userName',
					title: '用户名称',
				},
				{
					field: 'status',
					title: '检测结果',
					formatter: function (value, row, index) {
						if (row.status == 0) {
							return '<strong style="color: #00a65a">阴性</strong>';
						} else if (row.status == 1) {
							return '<strong style="color: #ad0404">阳性</strong>';
						}
					},
				},
				{
					field: 'redate',
					title: '检测日期'
				},
				{
					field: 'area',
					title: '检测单位'
				}]
			};
			$.table.init(options);
		});

		function queryParams(params) {  //配置参数
			var temp = {
				userId: userId
			};
			return temp;
		}
    </script>
</body>
</html>